from urllib.request import urlopen
from bs4 import BeautifulSoup as bs
from urllib.request import urlretrieve


url = urlopen('https://www.12306.cn/index')
obj = bs(url.read(), 'html.parser')
# title = obj.head.title
# 找到所有img标签
pics = obj.findAll('img')
for pic in pics:
    print(pic)